import {h, reactive} from "vue";
import dictHelp from "@/utils/dicthelp.js";

export default {
    /*用户	出货单	快递标签	FBA标	扫码换标	标签核对	查货	拣货时间	*/
    columns: reactive([
        {
            title: "主键",
            dataIndex: "id",
            formType: "input",
            addDisplay: false,
            editDisplay: false,
            hide: true,
            commonRules: {
                required: true,
                message: "请输入主键"
            }
        },
        {
            title: "运单号",
            dataIndex: "shipment_id",
            formType: "select",
            hide: true,
            commonRules: {
                required: true,
                message: "请输入运单号"
            },
            multiple: false
        },
        {
            title: "箱号",
            dataIndex: "number",
            formType: "input",
            search: true,
            customRender: ({record}) => {
                return h('div', [
                    h('span', record.number),
                    h('br'),
                    h('span', record.ext_number),
                ]);
            },
        },
        {
            title: "重量/尺寸",
            dataIndex: "actual_weight_size",
            formType: "input",
            customRender: ({record}) => {
                return h('div', [
                    h('span', record.actual_weight + 'KG'),
                    h('br'),
                    h('span', record.actual_length + '*' + record.actual_width + '*' + record.actual_height),
                ]);
            },
        },
        {
            title: "扩展箱号",
            dataIndex: "ext_number",
            hide: true,
            formType: "input"
        },
        {
            title: "客户重量",
            dataIndex: "client_weight",
            formType: "input",
            hide: true
        },
        {
            title: "客户长",
            dataIndex: "client_length",
            formType: "input",
            hide: true
        },
        {
            title: "客户宽",
            dataIndex: "client_width",
            formType: "input",
            hide: true
        },
        {
            title: "客户高",
            dataIndex: "client_height",
            formType: "input",
            hide: true
        },
        {
            title: "拣货重量",
            dataIndex: "actual_weight",
            formType: "input",
            hide: true
        },
        {
            title: "拣货材重",
            dataIndex: "actual_volume_weight",
            formType: "input",
            hide: true
        },
        {
            title: "拣货体积",
            dataIndex: "actual_volume",
            formType: "input",
            hide: true
        },
        {
            title: "拣货长",
            dataIndex: "actual_length",
            formType: "input",
            hide: true
        },
        {
            title: "拣货宽",
            dataIndex: "actual_width",
            formType: "input",
            hide: true
        },
        {
            title: "拣货高",
            dataIndex: "actual_height",
            formType: "input",
            hide: true
        },
        {
            title: "承运商",
            dataIndex: "outer_carrier_code",
            formType: "input",
            customRender: ({record}) => {
                return h('div', [
                    h('span', record.outer_carrier_code),
                    h('br'),
                    h('span', record.outer_carrier_tracking_number),
                ]);
            }
        },
        {
            title: "转单号",
            dataIndex: "outer_carrier_tracking_number",
            formType: "input",
            hide: true
        },
        {
            title: "当前货站",
            dataIndex: "depot_id",
            formType: "select",
            // customRender:({record,column,index})=>{
            //     console.log(column)
            //     return h('div',[
            //         h('span',record.actual_weight + 'KG'),
            //         h('br'),
            //         h('span',record.actual_length + '*' + record.actual_width + '*' + record.actual_height),
            //     ]);
            // },
            dict: dictHelp.depot
        },
        {
            title: "状态",
            dataIndex: "status",
            formType: "select",
            dict: {
                name: "shipment_parcel_type",
                props: {
                    label: "title",
                    value: "key"
                },
                translation: true
            },
        },
        {
            title: "拣货图片",
            dataIndex: "pick_img",
            formType: "input",
            hide: true
        },
        {
            title: "收费重",
            dataIndex: "charge_weight",
            formType: "input",
            hide: true
        },
        {
            title: "创建者",
            dataIndex: "created_by",
            formType: "input",
            addDisplay: false,
            editDisplay: false,
            hide: true
        },
        {
            title: "更新者",
            dataIndex: "updated_by",
            formType: "input",
            addDisplay: false,
            editDisplay: false,
            hide: true
        },
        {
            title: "创建时间",
            dataIndex: "created_at",
            formType: "date",
            // search: true,
            addDisplay: false,
            editDisplay: false,
            hide: true,
            sortable: {
                sortDirections: [
                    "ascend",
                    "descend"
                ],
                sorter: true
            },
            showTime: true
        },
        {
            title: "更新时间",
            dataIndex: "updated_at",
            formType: "date",
            addDisplay: false,
            editDisplay: false,
            hide: true,
            showTime: true
        },
        {
            title: "删除时间",
            dataIndex: "deleted_at",
            formType: "date",
            addDisplay: false,
            editDisplay: false,
            hide: true,
            showTime: true
        },
        {
            title: "备注",
            dataIndex: "remark",
            formType: "input",
            addDisplay: false,
            editDisplay: false,
            hide: true
        }
    ])
}